//
// Created by Zhangwj on 2023/9/26.
//

#ifndef COMPILE_TASK2_VARDEFNODE_H
#define COMPILE_TASK2_VARDEFNODE_H


#include "SyntaxTreeNode.h"
#include "../Parser.h"
#include "InitValNode.h"

class VarDefNode : SyntaxTreeNode {
public:
    //VarDef → Ident { '[' ConstExp ']' } | Ident { '[' ConstExp ']' } '=' InitVal
    std::unique_ptr<IdentNode> Ident;
    std::vector<std::unique_ptr<ConstExpNode>> ConstExps;
    std::unique_ptr<InitValNode> InitVal;

    static std::unique_ptr<VarDefNode> VarDefParser(Parser &parser);
};


#endif //COMPILE_TASK2_VARDEFNODE_H
